package com.java.base.exercise.proxy;

import com.java.base.exercise.proxymoudle.IUserApi;
import com.java.base.exercise.proxymoudle.UserApi;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @Author RenPu
 * @Date 2022/7/13 15:42
 * @Version 1.0
 * @Description: 温习反射
 **/
public class TestReflect {

    public static void main(String[] args)  {
        try {
            Class<UserApi> clazz = UserApi.class;
            Method queryUserInfo = clazz.getMethod("queryUserInfo");
            Object invoke = queryUserInfo.invoke(clazz.newInstance());
            //System.out.println(invoke);
            System.out.println(invoke.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



}
